package com.indusfo.spc.service.impl;

import com.indusfo.spc.mapper.BaseMapper;
import com.indusfo.spc.service.BaseService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * @Author: 熊冰
 * @Date: 2019/11/19 10:07
 */
@Service
public class BaseServiceImpl implements BaseService {
	private static final Logger logger = LoggerFactory.getLogger(BaseServiceImpl.class);
	@Resource
	private BaseMapper baseMapper;


	@Override
	@Transactional(rollbackFor = Exception.class)
	public void cascadeDeleteRole(Integer[] roleIds,Integer dataState) {
		if(roleIds!=null&&dataState!=null){
			baseMapper.cascadeDeleteRoleByUser(roleIds,dataState);
			baseMapper.cascadeDeleteRoleByStation(roleIds,dataState);
			baseMapper.cascadeDeleteRoleByMenu(roleIds,dataState);
		}




	}
}
